package random.fox.p2p.model;


import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;
import random.fox.p2p.AppModule;
import random.fox.p2p.interactors.LoginInteractor;
import random.fox.p2p.presenter.LoginPresenter;
import random.fox.p2p.presenter.LoginPresenterImpl;
import random.fox.p2p.ui.LoginView;
import random.fox.p2p.view.ILoginView;

/**
 * Created by delong on 2015/3/16.
 */

@Module(
        injects = {
        LoginView.class,
        },
        addsTo = AppModule.class
)
public class LoginModule {
    ILoginView loginView;

    public LoginModule(ILoginView iLoginView) {
        this.loginView = iLoginView;
    }

    @Provides @Singleton public ILoginView provideILoginView() {
        return loginView;
    }

    @Provides @Singleton public LoginPresenter providePresenter(ILoginView loginView, LoginInteractor loginInteractor) {
        return new LoginPresenterImpl(loginView, loginInteractor);
    }
}
